val ScalatraVersion = "2.6.3"

organization := "com.lzt"

name := "sjtp-query"

version := "0.1.0-SNAPSHOT"

scalaVersion := "2.12.4"

resolvers += Classpaths.typesafeReleases

libraryDependencies ++= Seq(
  "org.json4s" %% "json4s-jackson" % "3.5.3",
  "org.scalatra" %% "scalatra" % ScalatraVersion,
  "org.scalatra" %% "scalatra-scalatest" % ScalatraVersion % "test",
  "org.scalatra" %% "scalatra-specs2" % ScalatraVersion % Test,
  "org.scalatra" %% "scalatra-atmosphere" % ScalatraVersion,
  "ch.qos.logback" % "logback-classic" % "1.2.3",
  "org.eclipse.jetty" % "jetty-webapp" % "9.4.9.v20180320" % "container;compile",
  //  "org.eclipse.jetty" % "jetty-webapp" % "9.0.0.v20130308" % "container;compile",
  "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided",
  "org.apache.kafka" % "kafka-clients" % "0.10.2.2",
  "org.apache.hbase" % "hbase-client" % "1.2.3",
  "org.apache.hbase" % "hbase-server" % "1.2.3",
  "org.apache.hbase" % "hbase-common" % "1.2.3",
  "org.apache.hadoop" % "hadoop-common" % "2.7.1",
  "org.slf4j" % "log4j-over-slf4j" % "1.7.25",
  "org.slf4j" % "jcl-over-slf4j" % "1.7.25"
)

libraryDependencies ~= {
  _ map {
    case m =>
      m.exclude("log4j", "log4j").
        exclude("org.slf4j", "slf4j-log4j12").
        exclude("redis.clients", "jedis").
        exclude("commons-logging", "commons-logging")

  }
}
lazy val commonSettings = Seq(
  version := "0.1-SNAPSHOT",
  organization := "com.lzt",
  scalaVersion := "2.12.4",
  test in assembly := {}
)

lazy val app = (project in file("app")).
  settings(commonSettings: _*).
  settings(
    mainClass in assembly := Some("com.lzt.app.JettyLauncher"),
  )

assemblyMergeStrategy in assembly := {
//  case PathList("javax.servlet") => MergeStrategy.first
  case PathList("reference.conf") => MergeStrategy.concat
  case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
    case _ => MergeStrategy.concat
//  case x => val oldStrategy = (assemblyMergeStrategy in assembly).value
//    oldStrategy(x)
}

enablePlugins(ScalatraPlugin)
